<!-- <page-header-wrapper [title]="''"></page-header-wrapper>
<nz-card>
  <div nz-row nzGutter="8">
    <div nz-col [nzSpan]=" 24 ">
      <sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
    </div>
  </div>
  <div [class.text-right]="true">
    <button nz-button nzType="primary" [disabled]="!sf.valid" [nzLoading]="isLoading && st.loading" (click)="search()"
      acl [acl-ability]="['ORDER-REPORTING-search']">查询</button>
    <button nz-button (click)="resetSF()">重置</button>
    <button nz-button (click)="export()" acl [acl-ability]="['ORDER-REPORTING-export']">导出</button>
    <button nz-button nzType="link" (click)="expandToggle()">
      {{ !_$expand ? '展开' : '收起' }}
      <i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
    </button>
  </div>
</nz-card> -->
<nz-card class="table-box">
  <div class="tab_header">
    <label class="page_title"> <label class="driver">|</label> 订单上报</label>
    <nz-tabset [nzTabBarExtraContent]="extraTemplate">
      <nz-tab *ngFor="let tab of tabs" [nzTitle]="tab.name" (nzSelect)="selectChange(tab)"> </nz-tab>
    </nz-tabset>
  </div>

  <!-- 数据列表 -->
  <st
    #st
    [scroll]="{ x: '1200px', y: scrollY }"
    [data]="service.$api_get_order_reporting_page"
    [columns]="columns"
    [req]="{  process: beforeReq }"
    [res]="{  process: dataProcess }"
    [page]="{}"
    [loading]="service.http.loading"
    (change)="changeSt($event)"
  >
  <ng-template st-row="no" let-item let-index="index">
    <span >{{index}}</span>
  </ng-template>
    <ng-template st-row="billPutStatus" let-item let-index="index">
      <span *ngIf="item?.billPutStatus == '0'">待上传</span>
      <span *ngIf="item?.billPutStatus == '1'">已上传</span>
      <span *ngIf="item?.billPutStatus == '3'">上传中</span>
      <span *ngIf="item?.billPutStatus == '2'" style="color: red" (click)="viewAuditResult(item)">上传异常</span>
    </ng-template>
    <!-- <ng-template st-row="driverPutStatus" let-item let-index="index">
      <a (click)="viewAuditResult(item)"
        *ngIf="item?.driverPutStatus === '2'">{{filterStatus(item?.driverPutStatus)}}</a>
      <span *ngIf="item?.driverPutStatus !== '2'">{{filterStatus(item?.driverPutStatus)}}</span>
    </ng-template>
    <ng-template st-row="carPutStatus" let-item let-index="index">
      <a (click)="viewAuditResult(item)" *ngIf="item?.carPutStatus === '2'">{{filterStatus(item?.carPutStatus)}}</a>
      <span *ngIf="item?.carPutStatus !== '2'">{{filterStatus(item?.carPutStatus)}}</span>
    </ng-template> -->

    <ng-template st-row="checkStatus" let-item let-index="index">
      <a *ngIf="item?.checkStatus === '2'" acl [acl-ability]="['ORDER-REPORTING-view-upload-data']" (click)="viewResult(item)">{{
        filterCheckStatus(item?.checkStatus)
      }}</a>
      <span *ngIf="item?.checkStatus !== '2'" (click)="viewResult(item)">{{ filterCheckStatus(item?.checkStatus) }}</span>
    </ng-template>

    <ng-template st-row="billCode" let-item>
      <a class="text-red-dark" (click)="routeToOrder(item)">{{ item?.billCode }}</a>
    </ng-template>
    <ng-template st-row="wayBillCode" let-item>
      <a class="text-red-dark" (click)="routeTowaybill(item)">{{ item?.wayBillCode }}</a>
    </ng-template>

    <ng-template st-row="freightAmount" let-item let-index="index">
      <div class="text-right">{{ item?.freightAmount | currency }}</div>
    </ng-template>
    <ng-template st-row="goodsInfoList" let-item let-index="index">
      <div *ngFor="let _item of item?.goodsInfoList">
        {{ _item?.goodsTypeName }}/{{ _item?.goodsName }}/{{ _item?.weight }}吨/{{ _item?.volume }}m³
      </div>
    </ng-template>

    <ng-template st-row="car" let-item let-index="index">
      <a (click)="viewTrack(item, 'car')">查看轨迹</a>
    </ng-template>
    <ng-template st-row="driver" let-item let-index="index">
      <a (click)="viewTrack(item, 'driver')">查看轨迹</a>
    </ng-template>
  </st>
</nz-card>
<ng-template #extraTemplate>
  <div class="d-flex align-items-center mr-sm">
    <div class="mr-md d-flex align-items-center filter-box">
      <div class="mr-md">
        已选择
        <strong class="text-red">{{ selectedRows.length }}</strong> 条数据
      </div>
      <nz-select style="width: 150px;" [(ngModel)]="sfValue.networkTransporter" 
      >
      <nz-option *ngFor="let i of netWorkList" [nzLabel]="i.enterpriseName" [nzValue]="i.id" [nzDisabled]="i.disabled">
      </nz-option>
    </nz-select>
    </div>
    <button nz-button nzDanger (click)="search()" acl [acl-ability]="['ORDER-REPORTING-search']">查询</button>
 
    <button nz-button nzDanger (click)="export()" acl [acl-ability]="['ORDER-REPORTING-export']"> 导出</button>
    <button nz-button nz-dropdown [nzDropdownMenu]="menu" nzPlacement="bottomLeft">
      更多<i nz-icon nzType="down" nzTheme="outline"></i
    ></button>
    <nz-dropdown-menu #menu="nzDropdownMenu">
      <ul nz-menu>
        <li nz-menu-item acl [acl-ability]="['ORDER-REPORTING-searchAll']" (click)="openDrawer()"> 高级筛选 </li>
        <li nz-menu-item (click)="upload()" acl [acl-ability]="['ORDER-REPORTING-upload']"> 上传 </li>
        <li nz-menu-item (click)="recall()" acl [acl-ability]="['ORDER-REPORTING-recall']"> 撤回 </li>
        <li nz-menu-item (click)="updateData()" acl [acl-ability]="['ORDER-REPORTING-update-data']"> 更新数据 </li>
        <li nz-menu-item (click)="createZjUpload()" acl [acl-ability]="['ORDER-REPORTING-update-data']"> 生成资金 </li>
        <li nz-menu-item (click)="exceptionCross()" acl [acl-ability]="['ORDER-REPORTING-update-data']"> 异常通过 </li>
        <li nz-menu-item (click)="uploadSetting()" acl [acl-ability]="['ORDER-REPORTING-search-updata']"> 上传设置 </li>
      </ul>
    </nz-dropdown-menu>
  </div>
</ng-template>
